package fiziksobject;

import physics.Location;
import physics.Forcer;
import physics.Vector;
import physics.physicsobject;

public class FiziksBall extends physicsobject implements Forcer {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private double radius;

	public FiziksBall(double mass, double charge, Vector momentum, Location loc,
			double radius) {
		super(mass, charge, momentum, loc);
		this.radius = radius;
	}
	
	public boolean isColliding(physicsobject objectCompare){
		//System.out.println("collision testing");
		boolean collision = false;
		double radiusSum = ((FiziksBall) objectCompare).getRadius() + radius;
		Location loc2 = objectCompare.getLoc();
		Location loc1 = getLoc();
		double dist = loc1.distanceTo(loc2);
		//System.out.println(dist);
		if(dist <= radiusSum) {collision = true;}
		return collision;
	}

	

	public void setRadius(double radius) {
		this.radius = radius;
	}

	
	public double getRadius() {
		return radius;
	}

	
	public void checkInterference(physicsobject p){
		//TODO
	}
}
